package com.cgwx.aop.exception;

public enum ExceptionEnum {

    /**
     * Created by 77 on 2020/02/27
     */
    UNKNOWN_ERROR(-1, "未知错误"),
    PARAM_ILLEGAL(102, "传入的参数不合法"),
    METHOD_RETURN_NULL(103, "方法返回为空"),

    INSERTION_FAILED(301, "添加失败"),
    UPDATE_FAILED(303, "更新数据失败！"),
    DELETE_FAILED(304, "删除数据失败！"),

    /**
     * 参数错误
     * Created by 77 on 2020/02/27
     */
    INVALIDE_DATE_STRING(400, "输入日期格式不对"),
    START_TIME_IS_BIGGER(400, "开始时间大于结束时间"),
    MISSING_TIME(400, "缺失时间"),
    INVALIDE_SATELLITE_ID(400, "卫星id超出范围"),
    INVALIDE_PRODUCT_TYPE(400, "产品类型超出范围"),
    INVALIDE_IMAGE_GSD(400, "分辨率超出范围"),
    INVALIDE_PRODUCT_BAND(400, "数据谱段超出范围"),
    INVALIDE_CLOUD_PROCENT(400, "云量超出范围"),
    INVALIDE_ROLL_SATELLITE_ANGLE(400, "侧摆角超出范围"),
    WRONG_IMAGE_GSD(400, "分辨率错误"),
    WRONG_SATELLITE_ID(400, "卫星ID错误"),
    WRONG_PRODUCT_BAND(400, "数据谱段错误"),

    /**
     * 文件上传
     * Created by 77 on 2020/02/27
     */
    SHP_CREATE_ERROR(400, "shp创建失败"),
    ZIP_CREATE_ERROR(400, "zip创建失败"),
    FILE_READING_ERROR(400, "FILE_READING_ERROR!"),
    FILE_NOT_FOUND(400, "FILE_NOT_FOUND!"),
    UPLOAD_ERROR(500, "上传图片出错"),

    /**
     * token异常
     * Created by 77 on 2020/02/27
     */
    TOKEN_EXPIRED(700, "token过期"),
    TOKEN_ERROR(700, "token验证失败"),

    /**
     * 账户问题
     * Created by 77 on 2020/02/27
     */
    USER_ALREADY_REG(401, "该用户已经注册"),
    USER_NOT_EXISTED(401, "没有此用户"),
    ACCOUNT_FREEZED(401, "账号被冻结"),
    PASSWORD_WRONG(401, "密码错误"),
    OLD_PWD_NOT_RIGHT(402, "原密码不正确"),
    TWO_PWD_NOT_MATCH(405, "两次输入密码不一致"),
    /**
     * 其他
     * Created by 77 on 2020-02-28
     */
    AUTH_REQUEST_ERROR(400, "账号密码错误"),

    /**
     * 其他
     * Created by 77 on 2020/03/03
     */
    WRITE_ERROR(500, "渲染界面错误"),



    UPLOAD_FAILURE_REASON_EXCEPTION(104, "上传过程出现异常"),
    UPLOAD_FAILURE_REASON_NULL_FILE(105, "传入文件为空"),
    AREA_TOO_LARGE(401, "面积过大！"),
    CITY_PARAM_INVALID(402, "国内城市参数错误！"),
    SUBMIT_FAILED(403, "提交失败！可能原因：插入订单失败或发送短信失败"),
    MESSAGE_SEND_FAILED(404, "云信发送失败！"),
    CAL_AREA_ERROR(405, "计算面积出现错误！"),
    AREA_TOO_SMALL(406, "面积过小！"),
    PARAM_WRONG(501,"参数错误"),
    PARAM_NAME_REPETITION(502,"命名重复"),
    WEBSERVICE_RETURN_ERROR(514,"webservice返回错误"),
    PUBLISH_LAYER_ERROR(511,"图层发布错误"),
    ARCHIVE_PRODUCT_INVALD(503,"归档数据不满足归档规范！"),




    /**
     * qiqi 2017/11/14.
     */
    USER_NOT_EXIST(508, "用户名或密码不正确"),
    NOT_EXIST(509,"不存在"),
    EXIST(504, "已存在"),
    EXIST_USER(505, "存在用户"),



    ARCHIVE_FAILED(521, "已存在的归档"),

    ARCHIVE_IMAGE_FAILED(512, "已存在的图像归档"),
    ARCHIVE_VIDEO_FAILED(513, "已存在的视频归档"),

    FAILED(506, "失败"),
    ARCHIVE_THEMATIC_FAILED(518, "已存在的专题归档"),
    OVER_TIME(507, "超时"),
    JSON_ERROR(531, "JSON format error"),
    FORMAT_ERROR(530, "格式错误");







    private Integer code;

    private String message;

    ExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}